Ext.define('DragonApp.view.hero.Query', {
    extend: 'Ext.form.Panel',
    alias: ['widget.heroquery'],

    requires: [
        'DragonApp.view.pub.form.field.CharacterID',
        'DragonApp.view.pub.combobox.Server'
    ],
    controller: 'hero',
    reference: 'heroform',

    bodyPadding: 5,
    border: false,


    fieldDefaults: {
        labelWidth: 60,
        labelAlign: 'right'
    },

    items: [{
        xtype: 'fieldcontainer',
        layout: 'hbox',
        defaults: {
            listeners: {
                specialKey: 'onTextFieldSpecialKey'
            }
        },
        items: [
            { xtype: "servercombobox", name: "sid", fieldLabel: "服务器", width: 238 },
            { xtype: "textfield_cid", name: "id", fieldLabel: "玩家ID", width: 238 },
            { xtype: "textfield", name: "nickname", fieldLabel: "玩家名", width: 238 }
        ]
    }],
    buttons: [{
        text: '取消',
        handler: function() {

            //清空查询表单
            var form = this.up('form').getForm();
            form.reset();

            //清空明细内容表单
            var grid = Ext.ComponentQuery.query('herogrid')[0];
            var store = grid.getStore();
            store.removeAll();
        }
    }, {
        text: '查询',
        formBind: true,
        disabled: true,
        handler: 'onSubmitClick'
    }]
});